import Vue from 'vue'
import {
  Button,
  Input,
  Form,
  FormItem,
  Message,
  Radio,
  RadioGroup,
  Cascader,
  Menu,
  MenuItem,
  Tooltip,
  Row,
  Col,
  Dialog,
  Tabs,
  TabPane,
  Tag,
  Card,
  Popover,
  Popconfirm,
  Image,
  MessageBox,
  Badge
} from 'element-ui'

Vue.use(Button)
Vue.use(Input)
Vue.use(Form)
Vue.use(FormItem)
Vue.use(Radio)
Vue.use(RadioGroup)
Vue.use(Cascader)
Vue.use(Menu)
Vue.use(MenuItem)
Vue.use(Tooltip)
Vue.use(Row)
Vue.use(Col)
Vue.use(Dialog)
Vue.use(Tabs)
Vue.use(TabPane)
Vue.use(Tag)
Vue.use(Card)
Vue.use(Popover)
Vue.use(Popconfirm)
Vue.use(Image)
Vue.use(Badge)

const msgTypeArr = ['success', 'error', 'warning', 'info', 'danger']
Vue.prototype.$message = Message
msgTypeArr.forEach(item => {
  Vue.prototype.$message[item] = function (msg) {
    Message({ message: msg, type: item, showClose: true })
  }
})
Vue.prototype.$prompt = MessageBox.prompt